
***Table 2 Descriptive analysis
sum2docx EI_1 treated post pGDP Transport1 Opening HC Urbanization SecondI Financial Technology using "table_2.docx", replace stats(N mean(%9.3f) sd(%9.3f) min(%9.3f) max(%9.3f) ) title("Table2：Descriptive analysis")
global control " pGDP Opening HC Transport1 Urbanization SecondI Financial Technology"
logout, save(Table_3) word replace:ttable3 $control, by(treat) format(%9.3f) notitle

***Table 3  Baseline results
reghdfe EI_1 did,absorb(province year) vce(r) 
reghdfe EI_1 did pGDP Opening HC Urbanization SecondI Financial Technology Transport1 ,absorb(province year) vce(r)

***Fig 2. Parallel trends test
global xlist "pGDP Opening HC Urbanization SecondI Financial Technology Transport1 "
gen policy=year-2016
tab policy
forvalue i = 10(-1)1 {
        gen pre_`i' = (policy == - `i' & treated==1)   
        }
gen current=(policy==0 & treated==1)
forvalue j = 1(1)4 {
       gen post_`j' = (policy == `j' & treated==1) 
       }
drop current
reghdfe EI_1 pre_* current post_* $xlist,absorb(province year) vce(r)
coefplot,
    baselevels ///
    omitted 
    keep(pre_* current post*) 
    vertical recast(connect) ///
    order(pre_10 
          pre_9 
	      pre_8 
	      pre_7 
	      pre_6 
	      pre_5 
	      pre_4 
	      pre_3 
	      pre_2 
	      pre_1 
	      current 
	      post_1 
	      post_2 
	      post_3 
	      post_4) 
	yline(0,lp(solid) lc(black)) 
	ytitle("coeff. of VAT shock") xtitle("year") 
	xlabel(1 "-9" 2 "-8" 3 "-7" 4 "-6" 5 "-5" 6 "-4" 7 "-3" 8 "-2" 9 "-1" 10 "0" 11 "1" 12 "2" 13 "3" 14 "4") 
	ciopts(recast(rcap) lc(black) lp(dash) lw(thin)) scale(1.0)

***	
forvalues j=10(-1)1{
    gen b_`j'=_b[pre_`j']
}
gen ave_coge=(b_1+b_2+b_3+b_4+b_5+b_6+b_7+b_8+b_9+b_10)/10
su ave_coge  
return list
coefplot,
    baselevels 
	omitted 
	keep(pre_* current post_*) 
	vertical recast(connect) 
	order(pre_10 pre_9 pre_8 pre_7 pre_6 pre_5 pre_4 pre_3 pre_2 pre_1 current post_1 post_2 post_3 post_4) 
	yline(0,lp(solid) lc(black)) 
	ytitle("coeff. of VAT shock") xtitle("year") 
	xlabel(1 "-9" 2 "-8" 3 "-7" 4 "-6" 5 "-5" 6 "-4" 7 "-3" 8 "-2" 9 "-1" 10 "0" 11 "1" 12 "2" 13 "3" 14 "4") 
	transform( post_i=@-r(mean)) 
	ciopts(recast(rcap) lc(black) lp(dash) lw(thin)) scale(1.0)


***Table 4 Time placebo test: Altering the timing of reform implementation
reghdfe EI_1 did2011 pGDP Opening HC Transport1 Urbanization SecondI Financial Technology,absorb(province year) vce(r)
reghdfe EI_1 did2013 pGDP Opening HC Transport1 Urbanization SecondI Financial Technology,absorb(province year) vce(r)

***Fig 3. Distribution of estimated coefficients from randomly generated treatment groups
xtset id year
global xlist "pGDP Opening HC Transport1 Urbanization SecondI Financial Technology"
reghdfe EI_1 did $xlist,absorb( id year) vce(r)

mat b = J(500,1,0) 
mat se = J(500,1,0)  
mat p = J(500,1,0)

forvalue i=1/500{
  sysuse 安慰剂检验-随机抽检500次.dta, clear
  g obs_id= _n
  gen random_digit= runiform()
  sort random_digit
  g random_id= _n
  preserve
  keep random_id did
  rename did random_did
  rename random_id id
  label var id
  save random_did, replace
  restore
  drop random_digit random_id did
  rename obs_id id
  label var id
  save rawdata, replace
  use rawdata, clear
  merge 1:1 id using random_did,nogen
  reghdfe EI_1 random_did $xlist, absorb( province year)
  g _b_random_did= _b[random_did]
  g _se_random_did= _se[random_did]
  gen pvalue=2*ttail(e(df_r), abs(_b[random_did]/_se[random_did]))
  keep _b_random_did _se_random_did pvalue
  duplicates drop _b_random_did, force
  drop if pvalue ==.
  save placebo`i', replace
 }
 
 use placebo1, clear
forvalue i=2/500{
    append using placebo`i' 
    }
rename  _b_random_did coef1
twoway (kdensity coef1,yaxis(1)) (scatter pvalue coef1, msymbol(smcircle_hollow) yaxis(2)  mcolor(blue)), ///
title(Placebo Test) ///
xlabel(-0.02(0.001)0.02) ylabel(,axis(1) angle(0)) ylabel(0(1)5,axis(2)) ///
xline(0.019, lwidth(vthin) lp(shortdash)) xtitle(估计系数) ///
xline(0,lwidth(vthin) lp(shortdash)) ///
yline(0.1,lwidth(vthin) lp(dash)) ytitle(p value) ///
legend(label(1 'kdensity of estimates') label( 2 'p value')) ///
plotregion(style(none)) ///
graphregion(color(white))

***Table 5 Robustness checks
////Adjusting the setting standards for the treatment and control groups
reghdfe EI_1 did pGDP Opening HC Urbanization SecondI Financial Technology Transport1 ,absorb(province year) vce(r)
////Substitution of the dependent variable
reghdfe lnEI_2 did pGDP Opening HC Urbanization SecondI Financial Technology Transport1 ,absorb(province year) vce(r)
////Excluding the provincial capitals
reghdfe EI_1 did pGDP Opening HC Urbanization SecondI Financial Technology Transport1 ,absorb(province year) vce(r)
////Controlling for provincial fixed effects
reghdfe EI_1 did pGDP Opening HC Urbanization SecondI Financial Technology Transport1 ,absorb(province i.province#i.year) vce(r)

***Table 6 The results of regional heterogeneous effects
///geographical location
reghdfe EI_1 did pGDP Opening HC Transport1 Urbanization SecondI Financial Technology if location==0, absorb( province year) vce(r)
reghdfe EI_1 did pGDP Opening HC Transport1 Urbanization SecondI Financial Technology if location==1, absorb( province year) vce(r)
////Heterogeneity of energy dependence
bys id: egen B=mean( EI_1) if year<=2015
egen A=median(B)
bys id: egen C= median(B) 
gen big=1 if C>=A
replace big=0 if C<A
reghdfe EI_1 did pGDP Opening HC Transport1 Urbanization SecondI Financial Technology if big==0, absorb( province year) vce(r)
reghdfe EI_1 did pGDP Opening HC Transport1 Urbanization SecondI Financial Technology if big==1, absorb( province year) vce(r)

***Table 7 Moderating effects
reghdfe EI_1 did eri2 pGDP Opening HC Urbanization SecondI Financial Technology Transport1 ,absorb(province year) vce(r)
reghdfe EI_1 did pgcop pGDP Opening HC Urbanization SecondI Financial Technology Transport1 ,absorb(province year) vce(r)
reghdfe EI_1 did ps pGDP Opening HC Urbanization SecondI Financial Technology Transport1 ,absorb(province year) vce(r)

